package cn.sdfykjyxgs.syncommon.socket;

import cn.hutool.json.JSONObject;
import cn.sdfykjyxgs.syncommon.entity.FileChangeLog;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

@Data
@AllArgsConstructor
public class WebSocketMessage {
    /**
     * 用户ID
     */
    private String clientId;

    /**
     * 消息编码：可进行自定义，
     */
    private String messageCode;

    /**
     * 消息内容
     */
    private List<FileChangeLog> logs;

    private JSONObject jsonData;

    public WebSocketMessage() {
    }

    public WebSocketMessage(String clientId, String messageCode, List<FileChangeLog> logs) {
        this.clientId = clientId;
        this.messageCode = messageCode;
        this.logs = logs;
    }

    public WebSocketMessage(String clientId, String messageCode, JSONObject jsonData) {
        this.clientId = clientId;
        this.messageCode = messageCode;
        this.jsonData = jsonData;
    }
}
